<template>
  <div id="app">
    <el-button type="danger" size="mini" @click="logout">退出</el-button>
    <div>
      <div><span>ID:</span><span>{{this.$store.state.user.id}}</span></div>
      <div><span>用户名:</span><span>{{this.$store.state.user.username}}</span></div>
    </div>
    <router-view/>
  </div>
</template>

<script>
export default {
  name: 'App',
  data: function () {
    return {

    }
  },
  methods: {
    logout: function () {
      this.$store.commit('logout');
    }
  }
}
</script>

<style>
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #2c3e50;
}
</style>
